package cn.itcast.hotel.web;

import cn.itcast.hotel.pojo.PageResult;
import cn.itcast.hotel.pojo.RequestParams;
import cn.itcast.hotel.service.impl.HotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController()
@RequestMapping("/hotel")
public class HostController {

    @Autowired
    HotelService hotelService;

    @PostMapping("/list")
    public PageResult hotelList(@RequestBody RequestParams requestParams) throws IOException {
        return hotelService.hotelList(requestParams);
    }
}
